From 3bf2c9fb6d9047f32e9ae804531f4927f1980fcc Mon Sep 17 00:00:00 2001 From: robertl Date: Sat, 16 Jul 2005 18:53:41 +0000 Subject: [PATCH] Add 'testc' for coverage and new sample files. --- reference/expertgps.gpx | 1131 +++++++++++++++++++++++++++++++++++++++ testc | 56 ++ 2 files changed, 1187 insertions(+) create mode 100755 reference/expertgps.gpx create mode 100755 testc diff --git a/reference/expertgps.gpx b/reference/expertgps.gpx new file mode 100755 index 000000000..b15667965 --- /dev/null +++ b/reference/expertgps.gpx @@ -0,0 +1,1131 @@ + + + + + + + + 44.586548 + 5066 + 5066 + 5066 + Crossing + Crossing + + + 57.607200 + 5067 + 5067 + 5067 + Dot + Intersection + + + 44.826904 + 5096 + 5096 + 5096 + Dot + Dot + + + 50.594727 + 5142 + 5142 + 5142 + Dot + Dot + + + 127.711200 + 5156 + 5156 + 5156 + Dot + Intersection + + + 96.926400 + 5224 + 5224 + 5224 + Dot + Intersection + + + 82.600800 + 5229 + 5229 + 5229 + Dot + Intersection + + + 82.905600 + 5237 + 5237 + 5237 + Dot + Intersection + + + 66.696655 + 5254 + 5254 + 5254 + Dot + Dot + + + 74.627442 + 5258 + 5258 + 5258 + Dot + Dot + + + 65.254761 + 5264 + 5264 + 5264 + Dot + Dot + + + 77.419200 + 526708 + 526708 + 526708 + Dot + Intersection + + + 74.676000 + 526750 + 526750 + 526750 + Dot + Intersection + + + 78.713135 + 527614 + 527614 + 527614 + Dot + Dot + + + 78.713135 + 527631 + 527631 + 527631 + Dot + Dot + + + 68.275200 + 5278 + 5278 + 5278 + Dot + Intersection + + + 64.008000 + 5289 + 5289 + 5289 + Dot + Intersection + + + 52.997925 + 5374FIRE + 5374FIRE + 5374FIRE + Dot + Dot + + + 56.388000 + 5376 + 5376 + 5376 + Dot + Intersection + + + 56.388000 + 6006 + 600698 + 600698 + Dot + Intersection + + + 46.028564 + 6006BLUE + 6006BLUE + 6006BLUE + Dot + Dot + + + 37.616943 + 6014MEADOW + 6014MEADOW + 6014MEADOW + Dot + Dot + + + 56.388000 + 6029 + 6029 + 6029 + Dot + Intersection + + + 50.292000 + 6053 + 6053 + 6053 + Dot + Intersection + + + 25.603200 + 6066 + 6066 + 6066 + Dot + Intersection + + + 34.442400 + 6067 + 6067 + 6067 + Dot + Intersection + + + 30.480000 + 6071 + 6071 + 6071 + Dot + Intersection + + + 15.240000 + 6073 + 6073 + 6073 + Dot + Intersection + + + 37.795200 + 6084 + 6084 + 6084 + Dot + Intersection + + + 64.008000 + 6130 + 6130 + 6130 + Dot + Intersection + + + 64.008000 + 6131 + 6131 + 6131 + Dot + Intersection + + + 62.788800 + 6153 + 6153 + 6153 + Dot + Intersection + + + 55.473600 + 6171 + 6171 + 6171 + Dot + Intersection + + + 62.484000 + 6176 + 6176 + 6176 + Dot + Intersection + + + 62.179200 + 6177 + 6177 + 6177 + Dot + Intersection + + + 69.799200 + 6272 + 6272 + 6272 + Dot + Intersection + + + 73.152000 + 6272 + 6272 + 6272 + Dot + Intersection + + + 70.104000 + 6278 + 6278 + 6278 + Dot + Intersection + + + 57.564209 + 6280 + 6280 + 6280 + Dot + Dot + + + 66.696655 + 6283 + 6283 + 6283 + Dot + Dot + + + 72.945191 + 6289 + 6289 + 6289 + Dot + Dot + + + 72.847200 + 6297 + 6297 + 6297 + Dot + Intersection + + + 53.644800 + 6328 + 6328 + 6328 + Dot + Intersection + + + 43.891200 + 6354 + 6354 + 6354 + Dot + Intersection + + + 48.768000 + 635722 + 635722 + 635722 + Dot + Intersection + + + 49.072800 + 635783 + 635783 + 635783 + Dot + Intersection + + + 62.484000 + 6373 + 6373 + 6373 + Dot + Intersection + + + 3.962400 + 6634 + 6634 + 6634 + Dot + Intersection + + + 13.411200 + 6979 + 6979 + 6979 + Dot + Intersection + + + 34.012085 + 6997 + 6997 + 6997 + Dot + Dot + + + 87.782400 + BEAR HILL + BEAR HILL TOWER + Bear Hill Tower + Tall Tower + Tower + + + 23.469600 + BELLEVUE + BELLEVUE + Bellevue Parking Lot + Parking Area + Parking + + + 43.384766 + 6016 + Bike Loop Connector + Bike Loop Connector + Waypoint + Intersection + + + 89.916000 + 5236BRIDGE + Bridge + Bridge + Bridge + Bridge + + + 55.473600 + 5376BRIDGE + Bridge + Bridge + Bridge + Bridge + + + 52.730400 + 6181CROSS + Crossing + Crossing + Crossing + Crossing + + + 45.110400 + 6042CROSS + Crossing + Crossing + Crossing + Crossing + + + DARKHOLLPO + Dark Hollow Pond + Dark Hollow Pond + Fishing Area + + + 56.083200 + 6121DEAD + Dead End + Dead End + Danger Area + Dead End + + + 117.043200 + 5179DEAD + Dead End + Dead End + Danger Area + Dead End + + + 69.494400 + 5299DEAD + Dead End + Dead End + Danger Area + Dead End + + + 56.997600 + 5376DEAD + Dead End + Dead End + Danger Area + Dead End + + + 46.939200 + 6353DEAD + Dead End + Dead End + Danger Area + Dead End + + + 61.264800 + 6155DEAD + Dead End + Dead End + Danger Area + Dead End + + + 110.947200 + GATE14 + Gate 14 + Gate 14 + Truck Stop + Road + + + 77.724000 + GATE16 + Gate 16 + Gate 16 + Truck Stop + Road + + + 65.836800 + GATE17 + Gate 17 + Gate 17 + Truck Stop + Road + + + 57.302400 + GATE19 + Gate 19 + Gate 19 + Truck Stop + Road + + + 49.377600 + GATE21 + Gate 21 + Gate 21 + Truck Stop + Road + + + 81.076800 + GATE24 + Gate 24 + Gate 24 + Truck Stop + Road + + + 21.515015 + GATE5 + Gate 5 + Gate 5 + Truck Stop + Truck Stop + + + 26.561890 + GATE6 + Gate 6 + Gate 6 + Waypoint + Trail Head + + + 32.004000 + 6077LOGS + Log Crossing + Log Crossing + Amusement Park + Obstacle + + + 119.809082 + 5148NANEPA + Nanepashemet Road Crossing + Nanepashemet Road Crossing + Waypoint + Trail Head + + + 73.761600 + 5267OBSTAC + Obstacle + Obstacle + Amusement Park + Obstacle + + + 45.307495 + PANTHRCAVE + Panther Cave + Panther Cave + Tunnel + Tunnel + + + 77.992066 + 5252PURPLE + Purple Rock Hill + Purple Rock Hill + Summit + Summit + + + 67.970400 + 5287WATER + Reservoir + Reservoir + Swimming Area + Reservoir + + + 81.076800 + 5239ROAD + Road + Road + Truck Stop + Road + + + 67.360800 + 5278ROAD + Road + Road + Truck Stop + Road + + + 53.949600 + 5058ROAD + ROAD CROSSING + Road Crossing + Dot + Road Crossing + + + 69.799200 + SHEEPFOLD + Sheepfold Parking Lot + Sheepfold Parking Lot + Parking Area + Parking + + + 64.008000 + SOAPBOX + Soap Box Derby Track + Soap Box Derby Track + Cemetery + Intersection + + + 64.533692 + 5376STREAM + Stream Crossing + Stream Crossing + Bridge + Bridge + + + 61.649902 + 5144SUMMIT + Summit + Summit + Summit + Summit + + + 67.360800 + 5150TANK + WATER TANK + Water Tank + Museum + Water Tank + + + BELLEVUE + Bike Loop Bellevue + 1 + + 23.469600 + BELLEVUE + BELLEVUE + Bellevue Parking Lot + Parking Area + + + 26.561890 + GATE6 + Gate 6 + Waypoint + + + 45.307495 + PANTHRCAVE + Panther Cave + Tunnel + + + 37.616943 + 6014MEADOW + 6014MEADOW + Dot + + + 56.388000 + 6006 + 600698 + Dot + + + 46.028564 + 6006BLUE + 6006BLUE + Dot + + + 44.826904 + 5096 + 5096 + Dot + + + 44.586548 + 5066 + 5066 + Crossing + + + 57.607200 + 5067 + 5067 + Dot + + + 53.949600 + 5058ROAD + ROAD CROSSING + Road Crossing + Dot + + + 67.360800 + 5150TANK + WATER TANK + Water Tank + Museum + + + 50.594727 + 5142 + 5142 + Dot + + + 61.649902 + 5144SUMMIT + Summit + Summit + + + 127.711200 + 5156 + 5156 + Dot + + + 119.809082 + 5148NANEPA + Nanepashemet Road Crossing + Waypoint + + + 74.627442 + 5258 + 5258 + Dot + + + 77.992066 + 5252PURPLE + Purple Rock Hill + Summit + + + 78.713135 + 527631 + 527631 + Dot + + + 78.713135 + 527614 + 527614 + Dot + + + 73.761600 + 5267OBSTAC + Obstacle + Amusement Park + + + 68.275200 + 5278 + 5278 + Dot + + + 64.008000 + 5289 + 5289 + Dot + + + 52.997925 + 5374FIRE + 5374FIRE + Dot + + + 56.388000 + 5376 + 5376 + Dot + + + 64.533692 + 5376STREAM + Stream Crossing + Bridge + + + 53.644800 + 6328 + 6328 + Dot + + + 48.768000 + 635722 + 635722 + Dot + + + 49.072800 + 635783 + 635783 + Dot + + + 62.484000 + 6373 + 6373 + Dot + + + 87.782400 + BEAR HILL + BEAR HILL TOWER + Bear Hill Tower + Tall Tower + + + 72.945191 + 6289 + 6289 + Dot + + + 72.847200 + 6297 + 6297 + Dot + + + 66.696655 + 6283 + 6283 + Dot + + + 57.564209 + 6280 + 6280 + Dot + + + 62.179200 + 6177 + 6177 + Dot + + + 62.484000 + 6176 + 6176 + Dot + + + 62.788800 + 6153 + 6153 + Dot + + + 55.473600 + 6171 + 6171 + Dot + + + 64.008000 + 6131 + 6131 + Dot + + + 64.008000 + 6130 + 6130 + Dot + + + 56.388000 + 6029 + 6029 + Dot + + + 56.388000 + 6006 + 600698 + Dot + + + 37.616943 + 6014MEADOW + 6014MEADOW + Dot + + + 45.307495 + PANTHRCAVE + Panther Cave + Tunnel + + + 26.561890 + GATE6 + Gate 6 + Waypoint + + + 23.469600 + BELLEVUE + BELLEVUE + Bellevue Parking Lot + Parking Area + + + + 1 + + + 1.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2.000000 + + + + + 1.000000 + + + + + + + + + + + 2.000000 + + + 1.000000 + + + 1.000000 + + + + + 2.000000 + + + + + + + + + + + + + 6.000000 + + + 2.000000 + + + + + + + + + + + 1.000000 + + + + + + + 6.000000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 7.000000 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/testc b/testc new file mode 100755 index 000000000..38093cbd2 --- /dev/null +++ b/testc @@ -0,0 +1,56 @@ +#!/bin/bash + +# +# try to read and write all combinations we can. Don't try to +# be terribly portable and don't test for correctness. This test +# is meant for code coverage. +# + +# Exercise read and write of waypoint/track/route in every format. + +TMPD=/tmp/babeltest.$$ +GB="./gpsbabel" + +mkdir $TMPD + +rwall() { + name=$1 + cap=$2 + + REFFILE=reference/expertgps.gpx + + if [ $(echo $cap | grep -s w) ]; then + $GB -i gpx -f $REFFILE -o $name -F $TMPD/$name + if [ $(echo $cap | grep -s r) ]; then + $GB -i $name -f $TMPD/$name -o gpx -F /dev/null + fi + fi +} + +# +# Given a Geocache as input, verify we can write it. +# +wgc() { + name=$1 + cap=$2 + + REFDIR=reference/gc + if [ $(echo $cap | grep -s '^.w') ]; then + $GB -i gpx -f $REFDIR/GC7FA4.gpx -o $name -F $TMPD/$name-gc1 + $GB -i gpx -f $REFDIR/GCGCA8.gpx -o $name -F $TMPD/$name-gc2 + fi +} + + +$GB -^2 | while read fmt cap name junk +do + if [ "$fmt" != "file" ]; then + continue; + fi + + rwall $name $cap + wgc $name $cap + + echo $name + +done -- 2.30.2